package org.redis.cluster.transport.session;

public interface Session {

	/**
	 * 返回远程地址
	 * @return
	 */
	public String getRemoteAddress();
	
	/**
	 * 写入
	 * @param data
	 * @return
	 */
	public boolean write(Object data);
	
	/**
	 * 写入并刷新
	 * @param data
	 * @return
	 */
	public boolean writeAndFlush(Object data);
	
	/**
	 * 刷新
	 * @return
	 */
	public boolean flush();
	
	/**
	 * 返回上下文
	 * @return
	 */
	public SessionContext getContext();
	
	/**
	 * 关闭
	 * @return
	 */
	public boolean close();
}